home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 26 / AMIGAplus Sonderheft 26 (2000)(Falke)(DE)(Track 1 of 2)[!].iso / Tools / Packer / PPCUnACE / Src / acestruc.h next >
C/C++ Source or Header  |  1999-03-29  |  3KB  |  152 lines

  1. #ifndef __acestruc_h
  2. #define __acestruc_h
  3.  
  4. #include "declare.h"
  5. #include "portable.h"
  6.  
  7. #define acesign_len           7
  8. #define bytes_before_acesign  7
  9. #define acever               10
  10.  
  11. struct tech
  12. {
  13.    UCHAR TYPE;
  14.    UCHAR QUAL;
  15.    USHORT PARM;
  16. };
  17.  
  18. typedef struct tacehead
  19. {
  20.    USHORT HEAD_CRC;
  21.    USHORT HEAD_SIZE;
  22.    UCHAR  HEAD_TYPE;
  23.    USHORT HEAD_FLAGS;
  24.    ULONG  ADDSIZE;
  25.    UCHAR  other[2048];
  26.  
  27. }  thead;
  28.  
  29. typedef struct tacemhead
  30. {
  31.    USHORT HEAD_CRC;
  32.    USHORT HEAD_SIZE;
  33.    UCHAR  HEAD_TYPE;
  34.    USHORT HEAD_FLAGS;
  35.  
  36.    UCHAR  ACESIGN[acesign_len];
  37.    UCHAR  VER_MOD;
  38.    UCHAR  VER_CR;
  39.    UCHAR  HOST_CR;
  40.    UCHAR  VOL_NUM;
  41.    ULONG  TIME_CR;
  42.    USHORT RES1;
  43.    USHORT RES2;
  44.    ULONG  RES;
  45.    UCHAR  AV_SIZE;
  46.    UCHAR  AV[256];
  47.    USHORT COMM_SIZE;
  48.    UCHAR  COMM[2048];
  49.  
  50. }  tmhead;
  51.  
  52. #ifndef PATH_MAX
  53.   #define PATH_MAX   512
  54. #endif
  55.  
  56. typedef struct tacefhead
  57. {
  58.    USHORT HEAD_CRC;
  59.    USHORT HEAD_SIZE;
  60.    UCHAR  HEAD_TYPE;
  61.    USHORT HEAD_FLAGS;
  62.  
  63.    ULONG  PSIZE;
  64.    ULONG  SIZE;
  65.    ULONG  FTIME;
  66.    ULONG  ATTR;
  67.    ULONG  CRC32;
  68.    struct tech TECH;
  69.    USHORT RESERVED;
  70.    USHORT FNAME_SIZE;
  71.    UCHAR  FNAME[PATH_MAX];
  72.    USHORT COMM_SIZE;
  73.    UCHAR  COMM[2048];
  74.  
  75. }  tfhead;
  76.  
  77. #define mhead    (*t_mhead)
  78. #define fhead    (*t_fhead)
  79. #define rhead    (*t_rhead)
  80. #define tmpmhead (*t_tmpmhead)
  81. #define tmpfhead (*t_tmpfhead)
  82. #define tmprhead (*t_tmprhead)
  83.  
  84. #define mhead_size h_mhead_size(mhead)
  85. #define fhead_size h_fhead_size(fhead)
  86. #define rhead_size ((INT)&rhead.REC_CRC-(INT)&head.HEAD_TYPE+sizeof(rhead.REC_CRC))
  87.  
  88. #define h_mhead_size(phead) ((INT)mhead.AV-(INT)&head.HEAD_TYPE+        \
  89.                     (phead).AV_SIZE+                                    \
  90.                     ((phead).HEAD_FLAGS&ACE_COMM?                       \
  91.                       sizeof((phead).COMM_SIZE)+H_MCOMM_SIZE(phead):0))
  92.  
  93.  
  94. #define h_fhead_size(phead) ((INT)fhead.FNAME-(INT)&head.HEAD_TYPE+     \
  95.                     (phead).FNAME_SIZE+                                 \
  96.                     ((phead).HEAD_FLAGS&ACE_COMM?                       \
  97.                       sizeof((phead).COMM_SIZE)+H_FCOMM_SIZE(phead):0))
  98.  
  99.  
  100. //main-comment-definitions
  101. #define H_MCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).AV+(head).AV_SIZE))
  102. #define MCOMM_SIZE         H_MCOMM_SIZE(mhead)
  103. #define H_MCOMM(head)      ((UCHAR*)&(head).AV+(head).AV_SIZE+sizeof((head).COMM_SIZE))
  104. #define MCOMM              H_MCOMM(mhead)
  105.  
  106.  
  107. //file-comment-definitions
  108. #define H_FCOMM_SIZE(head) (BUF2WORD((UCHAR*)&(head).FNAME+(head).FNAME_SIZE))
  109. #define FCOMM_SIZE         H_FCOMM_SIZE(fhead)
  110. #define H_FCOMM(head)      ((UCHAR*)&(head).FNAME+(head).FNAME_SIZE+sizeof((head).COMM_SIZE))
  111. #define FCOMM              H_FCOMM(fhead)
  112.  
  113. //
  114. #define calc_head_crc getcrc16(CRC_MASK, (CHAR*)&head.HEAD_TYPE, head.HEAD_SIZE)
  115. #define GET_ADDSIZE   ((head.HEAD_FLAGS & ACE_ADDSIZE) ? head.ADDSIZE : 0)
  116.  
  117. //archive-header-flags
  118. #define ACE_LIM256   1024
  119. #define ACE_MULT_VOL 2048
  120. #define ACE_AV       4096
  121. #define ACE_RECOV    8192
  122. #define ACE_LOCK    16384
  123. #define ACE_SOLID   32768
  124.  
  125. //file-header-flags
  126. #define ACE_ADDSIZE  1
  127. #define ACE_PASSW    16384
  128. #define ACE_SP_BEF   4096
  129. #define ACE_SP_AFTER 8192
  130. #define ACE_COMM     2
  131.  
  132. //block types
  133. #define MAIN_BLK 0
  134. #define FILE_BLK 1
  135. #define REC_BLK  2
  136.  
  137. //known compression types
  138. #define TYPE_STORE 0
  139. #define TYPE_LZ1   1
  140.  
  141. //structure for archive handling
  142. struct tadat
  143. {
  144.    INT   sol,
  145.          vol,
  146.          vol_num;
  147.    ULONG time_cr;
  148. };
  149.  
  150.  
  151. #endif /* __acestruc_h */
  152.